<%@ page import="sys.Student" %>
<%@ page import="sys.UsersDao" %>
<%@ page import="sys.UsersDao" %><%--
  Created by IntelliJ IDEA.
  User: SeRein
  Date: 2021/4/1
  Time: 12:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    Student  stu = new Student()  ;
    UsersDao dao = new UsersDao()  ;

    /*获取传递过来的用户名和密码*/
    stu.setUserName(request.getParameter("userName"));
    stu.setPassWord(request.getParameter("passWord"));

    /*把获取来的数据和数据库中的数据进行对比*/
    boolean bl = dao.doLogin(stu);

    /*根据返回结果，跳转不同的页面*/
    if(bl==true)
    {
        response.sendRedirect("loginSuccess.jsp");
    }
    else
    {
        response.sendRedirect("login.jsp");
    }
%>


